Fix: Kokkos 5 performances on AMD - #402
Merged
Merged
Conversation
Contributor
Author
|
There was a problem hiding this comment.
Pull request overview
This PR aims to improve performance on AMD architectures with Kokkos 5 by constraining kernel launch characteristics, and also modernizes build-time metadata (version/compiler info) while adding a configurable way to suppress FMA for cross-architecture validation.
Changes:
- Constrain Kokkos
parallel_forrange kernels viaLaunchBounds<256>inidefix_forwrappers to mitigate AMD register spilling. - Replace the generated-in-source
version.hppmechanism with CMake-generated headers (version.h,compiler_info.h) and update outputs/version printing to use them. - Add
Idefix_SUPPRESS_FMAand aSuppressFMA.cmakehelper to disable FMA contraction across toolchains; update the Python test harness to enable it for bitwise-stable comparisons.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/version.h.in |
New template for a generated version header (commit + semantic version strings). |
src/compiler_info.h.in |
New template for a generated compiler metadata header. |
src/output/xdmf.cpp |
Switch XDMF header version string source to VersionInfo::version. |
src/output/vtk.cpp |
Switch VTK header version string source to VersionInfo::version. |
src/output/dump.cpp |
Switch dump header version string source to VersionInfo::version. |
src/input.cpp |
Print version via VersionInfo and add compiler metadata output. |
src/dataBlock/dumpToFile.cpp |
Switch debug dump header version string source to VersionInfo::version. |
src/loop.hpp |
Apply Kokkos LaunchBounds<256> to range-based parallel_for loops. |
pytools/idfx_test.py |
Enable Idefix_SUPPRESS_FMA in test CMake invocation for CPU/GPU bitwise consistency. |
CMakeLists.txt |
Add Idefix_SUPPRESS_FMA, generate headers via configure_file, and wire in suppression helper. |
cmake/SuppressFMA.cmake |
New module to apply backend/compiler-specific flags to suppress FMA contraction/codegen. |
Suppressed comments (2)
CMakeLists.txt:196
configure_file()writes to${CMAKE_BINARY_DIR}/build/generated/..., but that directory is never created. On a fresh build tree this will fail at configure time with a "cannot open output file" error. Create the directory once before the firstconfigure_file()call.
configure_file(
${CMAKE_SOURCE_DIR}/src/version.h.in
${CMAKE_BINARY_DIR}/build/generated/version.h
@ONLY
)
cmake/SuppressFMA.cmake:76
- The doc comment says the flags are applied "only when the SUPPRESS_FMA option is ON", but this module doesn't define/check that option (the caller currently gates via
Idefix_SUPPRESS_FMA). This is misleading if the function is reused elsewhere.
# Applies compiler-specific FMA-suppression flags to <target>'s CXX
# sources, but only when the SUPPRESS_FMA option is ON. Safe to call
# unconditionally.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Limit the thread size to avoid register spilling on AMD archs